﻿<UserControl x:Class="WickedFlame.VecDraw.Views.ToolBarView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:core="clr-namespace:WickedFlame.Core;assembly=VecDraw.Core"
             xmlns:t="clr-namespace:WickedFlame.Core.Tools;assembly=VecDraw.Core"
             xmlns:ctrl="clr-namespace:WickedFlame.VecDraw.Base.Controls;assembly=VecDraw.Base"
             xmlns:cv="clr-namespace:WickedFlame.Util.Converters;assembly=VecDraw.Util"
             mc:Ignorable="d" Background="Transparent" Loaded="UserControl_Loaded" FontSize="10" PreviewKeyDown="UserControl_PreviewKeyDown" PreviewKeyUp="UserControl_PreviewKeyDown">

    <Control.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Resources/ControlTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </Control.Resources>

    <Grid>
        <StackPanel Background="Transparent" Orientation="Horizontal" Height="30">
            
            <ComboBox MinWidth="60" Margin="4" DataContext="{x:Static core:DrawingCanvas.ToolsControler}" ItemsSource="{Binding Tools}" SelectedIndex="{Binding SelectedToolIndex}" FontSize="10">
                <ComboBox.Resources>
                    <ResourceDictionary>
                        <ResourceDictionary.MergedDictionaries>
                            <ResourceDictionary Source="/Resources/ToolDataTemplates.xaml" />
                        </ResourceDictionary.MergedDictionaries>
                    </ResourceDictionary>
                </ComboBox.Resources>
            </ComboBox>

            <!--<TextBlock DataContext="{x:Static core:DrawingCanvas.ToolsControler}" Text="{Binding SelectedTool}"/>-->
            <ContentPresenter Content="{Binding Source={x:Static core:DrawingCanvas.ToolsControler}, Path=SelectedTool}">
                <ContentPresenter.Resources>
                    <ResourceDictionary>
                        <ResourceDictionary.MergedDictionaries>
                            <ResourceDictionary Source="/Resources/ToolPropertyDataTemplates.xaml" />
                        </ResourceDictionary.MergedDictionaries>
                    </ResourceDictionary>
                </ContentPresenter.Resources>
            </ContentPresenter>
        </StackPanel>
    </Grid>
    
</UserControl>
